function [SignalAmpAnalog, NoiseAmpAnalog, Analog_TimeAxis,Signal ] = generateAnalogSignal( SigStruct,MWC )
%GENERATEANALOGSIGNAL Summary of this function goes here
%   Detailed explanation goes here

%factor to resemble the signal to analog one 
AnalogFactorRes = 5;
fmax = SigStruct.fmax;
fnyq = 2*fmax;
M = getfield(MWC, 'M');
m = getfield(MWC, 'm');
fp = getfield(MWC, 'fp');
Ts = getfield(MWC, 'Ts');
fs = getfield(MWC, 'fs');
q= getfield(MWC, 'q');
decfactor = ceil(fnyq*AnalogFactorRes/fs); % this is the decimation ratio from the Nyquist-rate to fp*q
fgrid = decfactor*fs;  % fgrid>=fnyq, and both fgrid/fp and fgrid/fs are integers
% decfactor = ceil(fnyq/fp); % this is the decimation ratio from the Nyquist-rate to fp
% fgrid = decfactor*fp;  % fgrid>=fnyq, and both fgrid/fp and fgrid/fs are integers

global NumSamplesFactor
% get the required number of samples
NumSamples = NumSamplesFactor*q ; % 999 Understand the mining of this number   %%str2double(get(handles.editNumSamples,'String'));
Npts = NumSamples*decfactor*2;  % we take a factor of 2.. just to be safe

 Signal = generateSignal(SigStruct, MWC,Npts,1/fgrid);

% generate signal at analog like density
[SignalAmpAnalog, NoiseAmpAnalog, Analog_TimeAxis] = GenerateSignalValues(Signal,MWC,1/fgrid,Npts);
end

